package top.yzlin.jqueryjx3strategystation.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import top.yzlin.jqueryjx3strategystation.entity.community.ReviewArticle;

@Repository
public interface ReviewArticleDAO extends JpaRepository<ReviewArticle,Integer> {


    @Query("select count(r)>0 from ReviewArticle r where article.articleId=:articleId")
    boolean isBanned(@Param("articleId") int articleId);

    @Query("from ReviewArticle where article.articleId=:articleId")
    ReviewArticle findReviewArticleByArticleId(@Param("articleId") int articleId);




}
